#include <iostream>
#include <vector>
using namespace std;
int n,m;
void dfs(int cur,int idx,vector<vector<int>>& vecRet,vector<int> path,vector<bool>& vecFlg){
	
	if(cur==m){
		vecRet.push_back(path);
		return;
	}
	for(int i=idx;i<=n;++i){
		if(vecFlg[i] || cur+i>m){
			continue;
		}
		path.push_back(i);
		vecFlg[i]=true;
		dfs(cur+i,i+1,vecRet,path,vecFlg);
		path.pop_back();
		vecFlg[i]=false;		
	}
}
int main() {
	
	cin>>n>>m;
	vector<bool> vecFlg(n+1);
	vector<vector<int>> vecRet;
	dfs(0,1,vecRet,vector<int>(),vecFlg);
	for(int i=0;i<vecRet.size();++i){
		for(int j=0;j<vecRet[i].size();++j){
			cout<<vecRet[i][j]<<' ';
		}
		cout<<endl;
	}
	
	return 0;
}
